<include file="Public/head" />
</head>
<body>
	<include file="Public/common_header" />
    <div class="mian">
        <include file="Public/sidebar" menu='zhgl.czzh' />
        <div class="mianR">

            <div class="listBox">
                <form id="fm" action="/CarOwner/user_list" method="GET">
                <div class="yuList">
                    <div class="deng-ji">
                        <input type="hidden" id="p" name='p' value="" />
                        <input type="text" name='search_key' value="{$search_key}" placeholder="车主姓名、车主电话"></div>
                    <div class="shangSou">
                        <input type="button" onclick="$('#fm #p').val('');$('#fm').submit();" value="搜索"></div>
                    <div class="xinzeng clearfix">
                         
                    </div>
                    <div class="yuListCo">
                        <h4 class="clearfix"> 
                            <em class="listW3">车主ID</em>
                            <em class="listW4">车主帐号</em>
                            <em class="listW5">车主姓名</em>
                            <em class="listW6">车主电话</em>
                            <em class="listW7">状态</em>
                            <em class="listW8-2">操作</em>
                        </h4>
                        <ul>
                            <?php foreach ($list as $key =>
                            $user): ?>
                            <li class="listBg clearfix">
                                <em class="listW3">{$user.owner_id}</em>
                                <em class="listW4">{$user.user_name}</em>
                                <em class="listW5">{$user.real_name}</em>
                                <em class="listW6">{$user.phone}</em>
                                <em class="listW7">{$user['status']?'禁用':'启用'}</em>
                                <em class="listW8-2" > 
                                    <a href="" title="开通帐号或重置用户密码!" onclick="return ci_op('{$user.owner_id}',3);">发送</a> 
                                    <!--<a href="" onclick="return ci_op('{$user.owner_id}',4);">查看</a> -->
                                    <if condition="($user.user_name neq '')">
                                        <if condition="($user.status eq 1)">
                                            <a href="" onclick="return ci_op('{$user.user_name}',0);">启用</a>
                                        <else />                                    
                                            <a href="" onclick="return ci_op('{$user.user_name}',1);">禁用</a>
                                        </if>
                                    </if>
                                </em>
                            </li>
                            <?php endforeach ?>                        

                        </ul>
                    </div>

                    <div class="pageFaye">
                        <div class="pager">
                            <span name="first" class="disabled" style="cursor: default;"><a num="{$page_data.first.num}" href="{$page_data.first.url}">首页</a></span>
                            <span name="prev" class="disabled" style="cursor: default;"><a num="{$page_data.prev.num}" href="{$page_data.prev.url}">上一页</a></span>
                            <span name="nav_fix" style="cursor: pointer;">
                                <?php foreach ($page_data['link_page'] as $page => $link): ?>
                                    <?php if($page == $p){ ?>
                                        <a class="navi"  num="<?php echo $page;?>" href="<?php echo $link;?>">
                                            <font style="color:#fff"><?php echo $page;?></font>
                                        </a>    
                                    <?php }else{?>
                                        <a class="navi"  num="<?php echo $page;?>" href="<?php echo $link;?>">
                                            <?php echo $page;?>
                                        </a>
                                    <?php }?>
                                <?php endforeach ?>                                
                            </span>
                            <span name="next" class="pageNext" style="cursor: pointer;"><a num="{$page_data.next.num}"  href="{$page_data.next.url}">下一页</a></span>
                            <span name="last" class="pageLast" style="cursor: pointer;"><a num="{$page_data.end.num}"  href="{$page_data.end.url}">末页</a></span>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <script type="text/javascript">
                        $('#fm .pageFaye a').click(function(){
                            $('#p').val($(this).attr('num'));
                            $('#fm').submit();
                            return false;
                        });
                    </script>
                </div>
                </form>
                
            </div>
        </div>
        <div class="clear"></div>
    </div>

<script>
    function ci_op(username,op_type){                
    var post_data = {username:username,op_type:op_type};    
    $.post('/CarOwner/ci_op',post_data,function(res){
        if(res.code==200){
            delay_alert('操作成功!');
            setTimeout(function(){
                window.location.reload();    
            },300);
        }else{
            delay_alert(res.msg);
        }
    },'json');
    return false;
};
</script>

<include file="Public/foot" />